<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    /*Window*/
    //获取
    window.alert("你好");
    alert("你好");
    //方法
    var flag = confirm("Are you sure you want to?");
    alert(flag);
    //setInterval,设置间隔
    var i = 0;
    setInterval(function () {
        i++;
        console.log(i);
    }, 1000);
    //setTimeout,设置终止
    setTimeout(function () {
        alert("JS");
    }, 3000);

    /*Location*/
    location.href="http://www.baidu.com";
</script>
</html>